/*
 * @Author: lwHao
 * @Date: 2020-09-20 16:21:04
 * @LastEditors: lwHao
 * @LastEditTime: 2020-09-20 16:27:52
 */
import {request}  from '@/plugins/request'

export const getComments = slug =>{
  return request({
    method: 'GET',
    url: `/api/articles/${slug}/comments`
  })
}

export const addComment = (slug,comment) =>{
  return request({
    method: 'POST',
    url: `/api/articles/${slug}/comments`,
    data:{comment}
  })
}

export const deleteComments = (slug,id) =>{
  return request({
    method: 'DELETE',
    url: `/api/articles/${slug}/comments/${id}`
  })
}